/*
 * Copyright 2023 ByteDance and/or its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

///
/// This file is auto generated by scripts/generate/country/convert.sh,
/// by using the data from https://download.geonames.org/export/dump/countryInfo.txt
///
use std::fmt;
use std::str::FromStr;

use crate::ContinentCode;

const ALL_COUNTRY_NAMES: &[&str] = &[
    "Andorra",
    "United Arab Emirates",
    "Afghanistan",
    "Antigua and Barbuda",
    "Anguilla",
    "Albania",
    "Armenia",
    "Angola",
    "Antarctica",
    "Argentina",
    "American Samoa",
    "Austria",
    "Australia",
    "Aruba",
    "Aland Islands",
    "Azerbaijan",
    "Bosnia and Herzegovina",
    "Barbados",
    "Bangladesh",
    "Belgium",
    "Burkina Faso",
    "Bulgaria",
    "Bahrain",
    "Burundi",
    "Benin",
    "Saint Barthelemy",
    "Bermuda",
    "Brunei",
    "Bolivia",
    "Bonaire, Saint Eustatius and Saba ",
    "Brazil",
    "Bahamas",
    "Bhutan",
    "Bouvet Island",
    "Botswana",
    "Belarus",
    "Belize",
    "Canada",
    "Cocos Islands",
    "Democratic Republic of the Congo",
    "Central African Republic",
    "Republic of the Congo",
    "Switzerland",
    "Ivory Coast",
    "Cook Islands",
    "Chile",
    "Cameroon",
    "China",
    "Colombia",
    "Costa Rica",
    "Cuba",
    "Cabo Verde",
    "Curacao",
    "Christmas Island",
    "Cyprus",
    "Czechia",
    "Germany",
    "Djibouti",
    "Denmark",
    "Dominica",
    "Dominican Republic",
    "Algeria",
    "Ecuador",
    "Estonia",
    "Egypt",
    "Western Sahara",
    "Eritrea",
    "Spain",
    "Ethiopia",
    "Finland",
    "Fiji",
    "Falkland Islands",
    "Micronesia",
    "Faroe Islands",
    "France",
    "Gabon",
    "United Kingdom",
    "Grenada",
    "Georgia",
    "French Guiana",
    "Guernsey",
    "Ghana",
    "Gibraltar",
    "Greenland",
    "Gambia",
    "Guinea",
    "Guadeloupe",
    "Equatorial Guinea",
    "Greece",
    "South Georgia and the South Sandwich Islands",
    "Guatemala",
    "Guam",
    "Guinea-Bissau",
    "Guyana",
    "Hong Kong",
    "Heard Island and McDonald Islands",
    "Honduras",
    "Croatia",
    "Haiti",
    "Hungary",
    "Indonesia",
    "Ireland",
    "Israel",
    "Isle of Man",
    "India",
    "British Indian Ocean Territory",
    "Iraq",
    "Iran",
    "Iceland",
    "Italy",
    "Jersey",
    "Jamaica",
    "Jordan",
    "Japan",
    "Kenya",
    "Kyrgyzstan",
    "Cambodia",
    "Kiribati",
    "Comoros",
    "Saint Kitts and Nevis",
    "North Korea",
    "South Korea",
    "Kosovo",
    "Kuwait",
    "Cayman Islands",
    "Kazakhstan",
    "Laos",
    "Lebanon",
    "Saint Lucia",
    "Liechtenstein",
    "Sri Lanka",
    "Liberia",
    "Lesotho",
    "Lithuania",
    "Luxembourg",
    "Latvia",
    "Libya",
    "Morocco",
    "Monaco",
    "Moldova",
    "Montenegro",
    "Saint Martin",
    "Madagascar",
    "Marshall Islands",
    "North Macedonia",
    "Mali",
    "Myanmar",
    "Mongolia",
    "Macao",
    "Northern Mariana Islands",
    "Martinique",
    "Mauritania",
    "Montserrat",
    "Malta",
    "Mauritius",
    "Maldives",
    "Malawi",
    "Mexico",
    "Malaysia",
    "Mozambique",
    "Namibia",
    "New Caledonia",
    "Niger",
    "Norfolk Island",
    "Nigeria",
    "Nicaragua",
    "The Netherlands",
    "Norway",
    "Nepal",
    "Nauru",
    "Niue",
    "New Zealand",
    "Oman",
    "Panama",
    "Peru",
    "French Polynesia",
    "Papua New Guinea",
    "Philippines",
    "Pakistan",
    "Poland",
    "Saint Pierre and Miquelon",
    "Pitcairn",
    "Puerto Rico",
    "Palestinian Territory",
    "Portugal",
    "Palau",
    "Paraguay",
    "Qatar",
    "Reunion",
    "Romania",
    "Serbia",
    "Russia",
    "Rwanda",
    "Saudi Arabia",
    "Solomon Islands",
    "Seychelles",
    "Sudan",
    "South Sudan",
    "Sweden",
    "Singapore",
    "Saint Helena",
    "Slovenia",
    "Svalbard and Jan Mayen",
    "Slovakia",
    "Sierra Leone",
    "San Marino",
    "Senegal",
    "Somalia",
    "Suriname",
    "Sao Tome and Principe",
    "El Salvador",
    "Sint Maarten",
    "Syria",
    "Eswatini",
    "Turks and Caicos Islands",
    "Chad",
    "French Southern Territories",
    "Togo",
    "Thailand",
    "Tajikistan",
    "Tokelau",
    "Timor Leste",
    "Turkmenistan",
    "Tunisia",
    "Tonga",
    "Turkey",
    "Trinidad and Tobago",
    "Tuvalu",
    "Taiwan",
    "Tanzania",
    "Ukraine",
    "Uganda",
    "United States Minor Outlying Islands",
    "United States",
    "Uruguay",
    "Uzbekistan",
    "Vatican",
    "Saint Vincent and the Grenadines",
    "Venezuela",
    "British Virgin Islands",
    "U.S. Virgin Islands",
    "Vietnam",
    "Vanuatu",
    "Wallis and Futuna",
    "Samoa",
    "Yemen",
    "Mayotte",
    "South Africa",
    "Zambia",
    "Zimbabwe",
    "Serbia and Montenegro",
    "Netherlands Antilles",
];

const ALL_ALPHA2_CODES: &[&str] = &[
    "AD", /* Andorra */
    "AE", /* United Arab Emirates */
    "AF", /* Afghanistan */
    "AG", /* Antigua and Barbuda */
    "AI", /* Anguilla */
    "AL", /* Albania */
    "AM", /* Armenia */
    "AO", /* Angola */
    "AQ", /* Antarctica */
    "AR", /* Argentina */
    "AS", /* American Samoa */
    "AT", /* Austria */
    "AU", /* Australia */
    "AW", /* Aruba */
    "AX", /* Aland Islands */
    "AZ", /* Azerbaijan */
    "BA", /* Bosnia and Herzegovina */
    "BB", /* Barbados */
    "BD", /* Bangladesh */
    "BE", /* Belgium */
    "BF", /* Burkina Faso */
    "BG", /* Bulgaria */
    "BH", /* Bahrain */
    "BI", /* Burundi */
    "BJ", /* Benin */
    "BL", /* Saint Barthelemy */
    "BM", /* Bermuda */
    "BN", /* Brunei */
    "BO", /* Bolivia */
    "BQ", /* Bonaire, Saint Eustatius and Saba  */
    "BR", /* Brazil */
    "BS", /* Bahamas */
    "BT", /* Bhutan */
    "BV", /* Bouvet Island */
    "BW", /* Botswana */
    "BY", /* Belarus */
    "BZ", /* Belize */
    "CA", /* Canada */
    "CC", /* Cocos Islands */
    "CD", /* Democratic Republic of the Congo */
    "CF", /* Central African Republic */
    "CG", /* Republic of the Congo */
    "CH", /* Switzerland */
    "CI", /* Ivory Coast */
    "CK", /* Cook Islands */
    "CL", /* Chile */
    "CM", /* Cameroon */
    "CN", /* China */
    "CO", /* Colombia */
    "CR", /* Costa Rica */
    "CU", /* Cuba */
    "CV", /* Cabo Verde */
    "CW", /* Curacao */
    "CX", /* Christmas Island */
    "CY", /* Cyprus */
    "CZ", /* Czechia */
    "DE", /* Germany */
    "DJ", /* Djibouti */
    "DK", /* Denmark */
    "DM", /* Dominica */
    "DO", /* Dominican Republic */
    "DZ", /* Algeria */
    "EC", /* Ecuador */
    "EE", /* Estonia */
    "EG", /* Egypt */
    "EH", /* Western Sahara */
    "ER", /* Eritrea */
    "ES", /* Spain */
    "ET", /* Ethiopia */
    "FI", /* Finland */
    "FJ", /* Fiji */
    "FK", /* Falkland Islands */
    "FM", /* Micronesia */
    "FO", /* Faroe Islands */
    "FR", /* France */
    "GA", /* Gabon */
    "GB", /* United Kingdom */
    "GD", /* Grenada */
    "GE", /* Georgia */
    "GF", /* French Guiana */
    "GG", /* Guernsey */
    "GH", /* Ghana */
    "GI", /* Gibraltar */
    "GL", /* Greenland */
    "GM", /* Gambia */
    "GN", /* Guinea */
    "GP", /* Guadeloupe */
    "GQ", /* Equatorial Guinea */
    "GR", /* Greece */
    "GS", /* South Georgia and the South Sandwich Islands */
    "GT", /* Guatemala */
    "GU", /* Guam */
    "GW", /* Guinea-Bissau */
    "GY", /* Guyana */
    "HK", /* Hong Kong */
    "HM", /* Heard Island and McDonald Islands */
    "HN", /* Honduras */
    "HR", /* Croatia */
    "HT", /* Haiti */
    "HU", /* Hungary */
    "ID", /* Indonesia */
    "IE", /* Ireland */
    "IL", /* Israel */
    "IM", /* Isle of Man */
    "IN", /* India */
    "IO", /* British Indian Ocean Territory */
    "IQ", /* Iraq */
    "IR", /* Iran */
    "IS", /* Iceland */
    "IT", /* Italy */
    "JE", /* Jersey */
    "JM", /* Jamaica */
    "JO", /* Jordan */
    "JP", /* Japan */
    "KE", /* Kenya */
    "KG", /* Kyrgyzstan */
    "KH", /* Cambodia */
    "KI", /* Kiribati */
    "KM", /* Comoros */
    "KN", /* Saint Kitts and Nevis */
    "KP", /* North Korea */
    "KR", /* South Korea */
    "XK", /* Kosovo */
    "KW", /* Kuwait */
    "KY", /* Cayman Islands */
    "KZ", /* Kazakhstan */
    "LA", /* Laos */
    "LB", /* Lebanon */
    "LC", /* Saint Lucia */
    "LI", /* Liechtenstein */
    "LK", /* Sri Lanka */
    "LR", /* Liberia */
    "LS", /* Lesotho */
    "LT", /* Lithuania */
    "LU", /* Luxembourg */
    "LV", /* Latvia */
    "LY", /* Libya */
    "MA", /* Morocco */
    "MC", /* Monaco */
    "MD", /* Moldova */
    "ME", /* Montenegro */
    "MF", /* Saint Martin */
    "MG", /* Madagascar */
    "MH", /* Marshall Islands */
    "MK", /* North Macedonia */
    "ML", /* Mali */
    "MM", /* Myanmar */
    "MN", /* Mongolia */
    "MO", /* Macao */
    "MP", /* Northern Mariana Islands */
    "MQ", /* Martinique */
    "MR", /* Mauritania */
    "MS", /* Montserrat */
    "MT", /* Malta */
    "MU", /* Mauritius */
    "MV", /* Maldives */
    "MW", /* Malawi */
    "MX", /* Mexico */
    "MY", /* Malaysia */
    "MZ", /* Mozambique */
    "NA", /* Namibia */
    "NC", /* New Caledonia */
    "NE", /* Niger */
    "NF", /* Norfolk Island */
    "NG", /* Nigeria */
    "NI", /* Nicaragua */
    "NL", /* The Netherlands */
    "NO", /* Norway */
    "NP", /* Nepal */
    "NR", /* Nauru */
    "NU", /* Niue */
    "NZ", /* New Zealand */
    "OM", /* Oman */
    "PA", /* Panama */
    "PE", /* Peru */
    "PF", /* French Polynesia */
    "PG", /* Papua New Guinea */
    "PH", /* Philippines */
    "PK", /* Pakistan */
    "PL", /* Poland */
    "PM", /* Saint Pierre and Miquelon */
    "PN", /* Pitcairn */
    "PR", /* Puerto Rico */
    "PS", /* Palestinian Territory */
    "PT", /* Portugal */
    "PW", /* Palau */
    "PY", /* Paraguay */
    "QA", /* Qatar */
    "RE", /* Reunion */
    "RO", /* Romania */
    "RS", /* Serbia */
    "RU", /* Russia */
    "RW", /* Rwanda */
    "SA", /* Saudi Arabia */
    "SB", /* Solomon Islands */
    "SC", /* Seychelles */
    "SD", /* Sudan */
    "SS", /* South Sudan */
    "SE", /* Sweden */
    "SG", /* Singapore */
    "SH", /* Saint Helena */
    "SI", /* Slovenia */
    "SJ", /* Svalbard and Jan Mayen */
    "SK", /* Slovakia */
    "SL", /* Sierra Leone */
    "SM", /* San Marino */
    "SN", /* Senegal */
    "SO", /* Somalia */
    "SR", /* Suriname */
    "ST", /* Sao Tome and Principe */
    "SV", /* El Salvador */
    "SX", /* Sint Maarten */
    "SY", /* Syria */
    "SZ", /* Eswatini */
    "TC", /* Turks and Caicos Islands */
    "TD", /* Chad */
    "TF", /* French Southern Territories */
    "TG", /* Togo */
    "TH", /* Thailand */
    "TJ", /* Tajikistan */
    "TK", /* Tokelau */
    "TL", /* Timor Leste */
    "TM", /* Turkmenistan */
    "TN", /* Tunisia */
    "TO", /* Tonga */
    "TR", /* Turkey */
    "TT", /* Trinidad and Tobago */
    "TV", /* Tuvalu */
    "TW", /* Taiwan */
    "TZ", /* Tanzania */
    "UA", /* Ukraine */
    "UG", /* Uganda */
    "UM", /* United States Minor Outlying Islands */
    "US", /* United States */
    "UY", /* Uruguay */
    "UZ", /* Uzbekistan */
    "VA", /* Vatican */
    "VC", /* Saint Vincent and the Grenadines */
    "VE", /* Venezuela */
    "VG", /* British Virgin Islands */
    "VI", /* U.S. Virgin Islands */
    "VN", /* Vietnam */
    "VU", /* Vanuatu */
    "WF", /* Wallis and Futuna */
    "WS", /* Samoa */
    "YE", /* Yemen */
    "YT", /* Mayotte */
    "ZA", /* South Africa */
    "ZM", /* Zambia */
    "ZW", /* Zimbabwe */
    "CS", /* Serbia and Montenegro */
    "AN", /* Netherlands Antilles */
];

const ALL_ALPHA3_CODES: &[&str] = &[
    "AND", /* Andorra */
    "ARE", /* United Arab Emirates */
    "AFG", /* Afghanistan */
    "ATG", /* Antigua and Barbuda */
    "AIA", /* Anguilla */
    "ALB", /* Albania */
    "ARM", /* Armenia */
    "AGO", /* Angola */
    "ATA", /* Antarctica */
    "ARG", /* Argentina */
    "ASM", /* American Samoa */
    "AUT", /* Austria */
    "AUS", /* Australia */
    "ABW", /* Aruba */
    "ALA", /* Aland Islands */
    "AZE", /* Azerbaijan */
    "BIH", /* Bosnia and Herzegovina */
    "BRB", /* Barbados */
    "BGD", /* Bangladesh */
    "BEL", /* Belgium */
    "BFA", /* Burkina Faso */
    "BGR", /* Bulgaria */
    "BHR", /* Bahrain */
    "BDI", /* Burundi */
    "BEN", /* Benin */
    "BLM", /* Saint Barthelemy */
    "BMU", /* Bermuda */
    "BRN", /* Brunei */
    "BOL", /* Bolivia */
    "BES", /* Bonaire, Saint Eustatius and Saba  */
    "BRA", /* Brazil */
    "BHS", /* Bahamas */
    "BTN", /* Bhutan */
    "BVT", /* Bouvet Island */
    "BWA", /* Botswana */
    "BLR", /* Belarus */
    "BLZ", /* Belize */
    "CAN", /* Canada */
    "CCK", /* Cocos Islands */
    "COD", /* Democratic Republic of the Congo */
    "CAF", /* Central African Republic */
    "COG", /* Republic of the Congo */
    "CHE", /* Switzerland */
    "CIV", /* Ivory Coast */
    "COK", /* Cook Islands */
    "CHL", /* Chile */
    "CMR", /* Cameroon */
    "CHN", /* China */
    "COL", /* Colombia */
    "CRI", /* Costa Rica */
    "CUB", /* Cuba */
    "CPV", /* Cabo Verde */
    "CUW", /* Curacao */
    "CXR", /* Christmas Island */
    "CYP", /* Cyprus */
    "CZE", /* Czechia */
    "DEU", /* Germany */
    "DJI", /* Djibouti */
    "DNK", /* Denmark */
    "DMA", /* Dominica */
    "DOM", /* Dominican Republic */
    "DZA", /* Algeria */
    "ECU", /* Ecuador */
    "EST", /* Estonia */
    "EGY", /* Egypt */
    "ESH", /* Western Sahara */
    "ERI", /* Eritrea */
    "ESP", /* Spain */
    "ETH", /* Ethiopia */
    "FIN", /* Finland */
    "FJI", /* Fiji */
    "FLK", /* Falkland Islands */
    "FSM", /* Micronesia */
    "FRO", /* Faroe Islands */
    "FRA", /* France */
    "GAB", /* Gabon */
    "GBR", /* United Kingdom */
    "GRD", /* Grenada */
    "GEO", /* Georgia */
    "GUF", /* French Guiana */
    "GGY", /* Guernsey */
    "GHA", /* Ghana */
    "GIB", /* Gibraltar */
    "GRL", /* Greenland */
    "GMB", /* Gambia */
    "GIN", /* Guinea */
    "GLP", /* Guadeloupe */
    "GNQ", /* Equatorial Guinea */
    "GRC", /* Greece */
    "SGS", /* South Georgia and the South Sandwich Islands */
    "GTM", /* Guatemala */
    "GUM", /* Guam */
    "GNB", /* Guinea-Bissau */
    "GUY", /* Guyana */
    "HKG", /* Hong Kong */
    "HMD", /* Heard Island and McDonald Islands */
    "HND", /* Honduras */
    "HRV", /* Croatia */
    "HTI", /* Haiti */
    "HUN", /* Hungary */
    "IDN", /* Indonesia */
    "IRL", /* Ireland */
    "ISR", /* Israel */
    "IMN", /* Isle of Man */
    "IND", /* India */
    "IOT", /* British Indian Ocean Territory */
    "IRQ", /* Iraq */
    "IRN", /* Iran */
    "ISL", /* Iceland */
    "ITA", /* Italy */
    "JEY", /* Jersey */
    "JAM", /* Jamaica */
    "JOR", /* Jordan */
    "JPN", /* Japan */
    "KEN", /* Kenya */
    "KGZ", /* Kyrgyzstan */
    "KHM", /* Cambodia */
    "KIR", /* Kiribati */
    "COM", /* Comoros */
    "KNA", /* Saint Kitts and Nevis */
    "PRK", /* North Korea */
    "KOR", /* South Korea */
    "XKX", /* Kosovo */
    "KWT", /* Kuwait */
    "CYM", /* Cayman Islands */
    "KAZ", /* Kazakhstan */
    "LAO", /* Laos */
    "LBN", /* Lebanon */
    "LCA", /* Saint Lucia */
    "LIE", /* Liechtenstein */
    "LKA", /* Sri Lanka */
    "LBR", /* Liberia */
    "LSO", /* Lesotho */
    "LTU", /* Lithuania */
    "LUX", /* Luxembourg */
    "LVA", /* Latvia */
    "LBY", /* Libya */
    "MAR", /* Morocco */
    "MCO", /* Monaco */
    "MDA", /* Moldova */
    "MNE", /* Montenegro */
    "MAF", /* Saint Martin */
    "MDG", /* Madagascar */
    "MHL", /* Marshall Islands */
    "MKD", /* North Macedonia */
    "MLI", /* Mali */
    "MMR", /* Myanmar */
    "MNG", /* Mongolia */
    "MAC", /* Macao */
    "MNP", /* Northern Mariana Islands */
    "MTQ", /* Martinique */
    "MRT", /* Mauritania */
    "MSR", /* Montserrat */
    "MLT", /* Malta */
    "MUS", /* Mauritius */
    "MDV", /* Maldives */
    "MWI", /* Malawi */
    "MEX", /* Mexico */
    "MYS", /* Malaysia */
    "MOZ", /* Mozambique */
    "NAM", /* Namibia */
    "NCL", /* New Caledonia */
    "NER", /* Niger */
    "NFK", /* Norfolk Island */
    "NGA", /* Nigeria */
    "NIC", /* Nicaragua */
    "NLD", /* The Netherlands */
    "NOR", /* Norway */
    "NPL", /* Nepal */
    "NRU", /* Nauru */
    "NIU", /* Niue */
    "NZL", /* New Zealand */
    "OMN", /* Oman */
    "PAN", /* Panama */
    "PER", /* Peru */
    "PYF", /* French Polynesia */
    "PNG", /* Papua New Guinea */
    "PHL", /* Philippines */
    "PAK", /* Pakistan */
    "POL", /* Poland */
    "SPM", /* Saint Pierre and Miquelon */
    "PCN", /* Pitcairn */
    "PRI", /* Puerto Rico */
    "PSE", /* Palestinian Territory */
    "PRT", /* Portugal */
    "PLW", /* Palau */
    "PRY", /* Paraguay */
    "QAT", /* Qatar */
    "REU", /* Reunion */
    "ROU", /* Romania */
    "SRB", /* Serbia */
    "RUS", /* Russia */
    "RWA", /* Rwanda */
    "SAU", /* Saudi Arabia */
    "SLB", /* Solomon Islands */
    "SYC", /* Seychelles */
    "SDN", /* Sudan */
    "SSD", /* South Sudan */
    "SWE", /* Sweden */
    "SGP", /* Singapore */
    "SHN", /* Saint Helena */
    "SVN", /* Slovenia */
    "SJM", /* Svalbard and Jan Mayen */
    "SVK", /* Slovakia */
    "SLE", /* Sierra Leone */
    "SMR", /* San Marino */
    "SEN", /* Senegal */
    "SOM", /* Somalia */
    "SUR", /* Suriname */
    "STP", /* Sao Tome and Principe */
    "SLV", /* El Salvador */
    "SXM", /* Sint Maarten */
    "SYR", /* Syria */
    "SWZ", /* Eswatini */
    "TCA", /* Turks and Caicos Islands */
    "TCD", /* Chad */
    "ATF", /* French Southern Territories */
    "TGO", /* Togo */
    "THA", /* Thailand */
    "TJK", /* Tajikistan */
    "TKL", /* Tokelau */
    "TLS", /* Timor Leste */
    "TKM", /* Turkmenistan */
    "TUN", /* Tunisia */
    "TON", /* Tonga */
    "TUR", /* Turkey */
    "TTO", /* Trinidad and Tobago */
    "TUV", /* Tuvalu */
    "TWN", /* Taiwan */
    "TZA", /* Tanzania */
    "UKR", /* Ukraine */
    "UGA", /* Uganda */
    "UMI", /* United States Minor Outlying Islands */
    "USA", /* United States */
    "URY", /* Uruguay */
    "UZB", /* Uzbekistan */
    "VAT", /* Vatican */
    "VCT", /* Saint Vincent and the Grenadines */
    "VEN", /* Venezuela */
    "VGB", /* British Virgin Islands */
    "VIR", /* U.S. Virgin Islands */
    "VNM", /* Vietnam */
    "VUT", /* Vanuatu */
    "WLF", /* Wallis and Futuna */
    "WSM", /* Samoa */
    "YEM", /* Yemen */
    "MYT", /* Mayotte */
    "ZAF", /* South Africa */
    "ZMB", /* Zambia */
    "ZWE", /* Zimbabwe */
    "SCG", /* Serbia and Montenegro */
    "ANT", /* Netherlands Antilles */
];

const ALPHA2_FAST_MAP: &[IsoCountryCode] = &[
    IsoCountryCode::AN, // 0
    IsoCountryCode::AN, // 1
    IsoCountryCode::AN, // 2
    IsoCountryCode::AD, // 3 - AD
    IsoCountryCode::AE, // 4 - AE
    IsoCountryCode::AF, // 5 - AF
    IsoCountryCode::AG, // 6 - AG
    IsoCountryCode::AN, // 7
    IsoCountryCode::AI, // 8 - AI
    IsoCountryCode::AN, // 9
    IsoCountryCode::AN, // 10
    IsoCountryCode::AL, // 11 - AL
    IsoCountryCode::AM, // 12 - AM
    IsoCountryCode::AN, // 13 - AN
    IsoCountryCode::AO, // 14 - AO
    IsoCountryCode::AN, // 15
    IsoCountryCode::AQ, // 16 - AQ
    IsoCountryCode::AR, // 17 - AR
    IsoCountryCode::AS, // 18 - AS
    IsoCountryCode::AT, // 19 - AT
    IsoCountryCode::AU, // 20 - AU
    IsoCountryCode::AN, // 21
    IsoCountryCode::AW, // 22 - AW
    IsoCountryCode::AX, // 23 - AX
    IsoCountryCode::AN, // 24
    IsoCountryCode::AZ, // 25 - AZ
    IsoCountryCode::BA, // 26 - BA
    IsoCountryCode::BB, // 27 - BB
    IsoCountryCode::AN, // 28
    IsoCountryCode::BD, // 29 - BD
    IsoCountryCode::BE, // 30 - BE
    IsoCountryCode::BF, // 31 - BF
    IsoCountryCode::BG, // 32 - BG
    IsoCountryCode::BH, // 33 - BH
    IsoCountryCode::BI, // 34 - BI
    IsoCountryCode::BJ, // 35 - BJ
    IsoCountryCode::AN, // 36
    IsoCountryCode::BL, // 37 - BL
    IsoCountryCode::BM, // 38 - BM
    IsoCountryCode::BN, // 39 - BN
    IsoCountryCode::BO, // 40 - BO
    IsoCountryCode::AN, // 41
    IsoCountryCode::BQ, // 42 - BQ
    IsoCountryCode::BR, // 43 - BR
    IsoCountryCode::BS, // 44 - BS
    IsoCountryCode::BT, // 45 - BT
    IsoCountryCode::AN, // 46
    IsoCountryCode::BV, // 47 - BV
    IsoCountryCode::BW, // 48 - BW
    IsoCountryCode::AN, // 49
    IsoCountryCode::BY, // 50 - BY
    IsoCountryCode::BZ, // 51 - BZ
    IsoCountryCode::CA, // 52 - CA
    IsoCountryCode::AN, // 53
    IsoCountryCode::CC, // 54 - CC
    IsoCountryCode::CD, // 55 - CD
    IsoCountryCode::AN, // 56
    IsoCountryCode::CF, // 57 - CF
    IsoCountryCode::CG, // 58 - CG
    IsoCountryCode::CH, // 59 - CH
    IsoCountryCode::CI, // 60 - CI
    IsoCountryCode::AN, // 61
    IsoCountryCode::CK, // 62 - CK
    IsoCountryCode::CL, // 63 - CL
    IsoCountryCode::CM, // 64 - CM
    IsoCountryCode::CN, // 65 - CN
    IsoCountryCode::CO, // 66 - CO
    IsoCountryCode::AN, // 67
    IsoCountryCode::AN, // 68
    IsoCountryCode::CR, // 69 - CR
    IsoCountryCode::CS, // 70 - CS
    IsoCountryCode::AN, // 71
    IsoCountryCode::CU, // 72 - CU
    IsoCountryCode::CV, // 73 - CV
    IsoCountryCode::CW, // 74 - CW
    IsoCountryCode::CX, // 75 - CX
    IsoCountryCode::CY, // 76 - CY
    IsoCountryCode::CZ, // 77 - CZ
    IsoCountryCode::AN, // 78
    IsoCountryCode::AN, // 79
    IsoCountryCode::AN, // 80
    IsoCountryCode::AN, // 81
    IsoCountryCode::DE, // 82 - DE
    IsoCountryCode::AN, // 83
    IsoCountryCode::AN, // 84
    IsoCountryCode::AN, // 85
    IsoCountryCode::AN, // 86
    IsoCountryCode::DJ, // 87 - DJ
    IsoCountryCode::DK, // 88 - DK
    IsoCountryCode::AN, // 89
    IsoCountryCode::DM, // 90 - DM
    IsoCountryCode::AN, // 91
    IsoCountryCode::DO, // 92 - DO
    IsoCountryCode::AN, // 93
    IsoCountryCode::AN, // 94
    IsoCountryCode::AN, // 95
    IsoCountryCode::AN, // 96
    IsoCountryCode::AN, // 97
    IsoCountryCode::AN, // 98
    IsoCountryCode::AN, // 99
    IsoCountryCode::AN, // 100
    IsoCountryCode::AN, // 101
    IsoCountryCode::AN, // 102
    IsoCountryCode::DZ, // 103 - DZ
    IsoCountryCode::AN, // 104
    IsoCountryCode::AN, // 105
    IsoCountryCode::EC, // 106 - EC
    IsoCountryCode::AN, // 107
    IsoCountryCode::EE, // 108 - EE
    IsoCountryCode::AN, // 109
    IsoCountryCode::EG, // 110 - EG
    IsoCountryCode::EH, // 111 - EH
    IsoCountryCode::AN, // 112
    IsoCountryCode::AN, // 113
    IsoCountryCode::AN, // 114
    IsoCountryCode::AN, // 115
    IsoCountryCode::AN, // 116
    IsoCountryCode::AN, // 117
    IsoCountryCode::AN, // 118
    IsoCountryCode::AN, // 119
    IsoCountryCode::AN, // 120
    IsoCountryCode::ER, // 121 - ER
    IsoCountryCode::ES, // 122 - ES
    IsoCountryCode::ET, // 123 - ET
    IsoCountryCode::AN, // 124
    IsoCountryCode::AN, // 125
    IsoCountryCode::AN, // 126
    IsoCountryCode::AN, // 127
    IsoCountryCode::AN, // 128
    IsoCountryCode::AN, // 129
    IsoCountryCode::AN, // 130
    IsoCountryCode::AN, // 131
    IsoCountryCode::AN, // 132
    IsoCountryCode::AN, // 133
    IsoCountryCode::AN, // 134
    IsoCountryCode::AN, // 135
    IsoCountryCode::AN, // 136
    IsoCountryCode::AN, // 137
    IsoCountryCode::FI, // 138 - FI
    IsoCountryCode::FJ, // 139 - FJ
    IsoCountryCode::FK, // 140 - FK
    IsoCountryCode::AN, // 141
    IsoCountryCode::FM, // 142 - FM
    IsoCountryCode::AN, // 143
    IsoCountryCode::FO, // 144 - FO
    IsoCountryCode::AN, // 145
    IsoCountryCode::AN, // 146
    IsoCountryCode::FR, // 147 - FR
    IsoCountryCode::AN, // 148
    IsoCountryCode::AN, // 149
    IsoCountryCode::AN, // 150
    IsoCountryCode::AN, // 151
    IsoCountryCode::AN, // 152
    IsoCountryCode::AN, // 153
    IsoCountryCode::AN, // 154
    IsoCountryCode::AN, // 155
    IsoCountryCode::GA, // 156 - GA
    IsoCountryCode::GB, // 157 - GB
    IsoCountryCode::AN, // 158
    IsoCountryCode::GD, // 159 - GD
    IsoCountryCode::GE, // 160 - GE
    IsoCountryCode::GF, // 161 - GF
    IsoCountryCode::GG, // 162 - GG
    IsoCountryCode::GH, // 163 - GH
    IsoCountryCode::GI, // 164 - GI
    IsoCountryCode::AN, // 165
    IsoCountryCode::AN, // 166
    IsoCountryCode::GL, // 167 - GL
    IsoCountryCode::GM, // 168 - GM
    IsoCountryCode::GN, // 169 - GN
    IsoCountryCode::AN, // 170
    IsoCountryCode::GP, // 171 - GP
    IsoCountryCode::GQ, // 172 - GQ
    IsoCountryCode::GR, // 173 - GR
    IsoCountryCode::GS, // 174 - GS
    IsoCountryCode::GT, // 175 - GT
    IsoCountryCode::GU, // 176 - GU
    IsoCountryCode::AN, // 177
    IsoCountryCode::GW, // 178 - GW
    IsoCountryCode::AN, // 179
    IsoCountryCode::GY, // 180 - GY
    IsoCountryCode::AN, // 181
    IsoCountryCode::AN, // 182
    IsoCountryCode::AN, // 183
    IsoCountryCode::AN, // 184
    IsoCountryCode::AN, // 185
    IsoCountryCode::AN, // 186
    IsoCountryCode::AN, // 187
    IsoCountryCode::AN, // 188
    IsoCountryCode::AN, // 189
    IsoCountryCode::AN, // 190
    IsoCountryCode::AN, // 191
    IsoCountryCode::HK, // 192 - HK
    IsoCountryCode::AN, // 193
    IsoCountryCode::HM, // 194 - HM
    IsoCountryCode::HN, // 195 - HN
    IsoCountryCode::AN, // 196
    IsoCountryCode::AN, // 197
    IsoCountryCode::AN, // 198
    IsoCountryCode::HR, // 199 - HR
    IsoCountryCode::AN, // 200
    IsoCountryCode::HT, // 201 - HT
    IsoCountryCode::HU, // 202 - HU
    IsoCountryCode::AN, // 203
    IsoCountryCode::AN, // 204
    IsoCountryCode::AN, // 205
    IsoCountryCode::AN, // 206
    IsoCountryCode::AN, // 207
    IsoCountryCode::AN, // 208
    IsoCountryCode::AN, // 209
    IsoCountryCode::AN, // 210
    IsoCountryCode::ID, // 211 - ID
    IsoCountryCode::IE, // 212 - IE
    IsoCountryCode::AN, // 213
    IsoCountryCode::AN, // 214
    IsoCountryCode::AN, // 215
    IsoCountryCode::AN, // 216
    IsoCountryCode::AN, // 217
    IsoCountryCode::AN, // 218
    IsoCountryCode::IL, // 219 - IL
    IsoCountryCode::IM, // 220 - IM
    IsoCountryCode::IN, // 221 - IN
    IsoCountryCode::IO, // 222 - IO
    IsoCountryCode::AN, // 223
    IsoCountryCode::IQ, // 224 - IQ
    IsoCountryCode::IR, // 225 - IR
    IsoCountryCode::IS, // 226 - IS
    IsoCountryCode::IT, // 227 - IT
    IsoCountryCode::AN, // 228
    IsoCountryCode::AN, // 229
    IsoCountryCode::AN, // 230
    IsoCountryCode::AN, // 231
    IsoCountryCode::AN, // 232
    IsoCountryCode::AN, // 233
    IsoCountryCode::AN, // 234
    IsoCountryCode::AN, // 235
    IsoCountryCode::AN, // 236
    IsoCountryCode::AN, // 237
    IsoCountryCode::JE, // 238 - JE
    IsoCountryCode::AN, // 239
    IsoCountryCode::AN, // 240
    IsoCountryCode::AN, // 241
    IsoCountryCode::AN, // 242
    IsoCountryCode::AN, // 243
    IsoCountryCode::AN, // 244
    IsoCountryCode::AN, // 245
    IsoCountryCode::JM, // 246 - JM
    IsoCountryCode::AN, // 247
    IsoCountryCode::JO, // 248 - JO
    IsoCountryCode::JP, // 249 - JP
    IsoCountryCode::AN, // 250
    IsoCountryCode::AN, // 251
    IsoCountryCode::AN, // 252
    IsoCountryCode::AN, // 253
    IsoCountryCode::AN, // 254
    IsoCountryCode::AN, // 255
    IsoCountryCode::AN, // 256
    IsoCountryCode::AN, // 257
    IsoCountryCode::AN, // 258
    IsoCountryCode::AN, // 259
    IsoCountryCode::AN, // 260
    IsoCountryCode::AN, // 261
    IsoCountryCode::AN, // 262
    IsoCountryCode::AN, // 263
    IsoCountryCode::KE, // 264 - KE
    IsoCountryCode::AN, // 265
    IsoCountryCode::KG, // 266 - KG
    IsoCountryCode::KH, // 267 - KH
    IsoCountryCode::KI, // 268 - KI
    IsoCountryCode::AN, // 269
    IsoCountryCode::AN, // 270
    IsoCountryCode::AN, // 271
    IsoCountryCode::KM, // 272 - KM
    IsoCountryCode::KN, // 273 - KN
    IsoCountryCode::AN, // 274
    IsoCountryCode::KP, // 275 - KP
    IsoCountryCode::AN, // 276
    IsoCountryCode::KR, // 277 - KR
    IsoCountryCode::AN, // 278
    IsoCountryCode::AN, // 279
    IsoCountryCode::AN, // 280
    IsoCountryCode::AN, // 281
    IsoCountryCode::KW, // 282 - KW
    IsoCountryCode::AN, // 283
    IsoCountryCode::KY, // 284 - KY
    IsoCountryCode::KZ, // 285 - KZ
    IsoCountryCode::LA, // 286 - LA
    IsoCountryCode::LB, // 287 - LB
    IsoCountryCode::LC, // 288 - LC
    IsoCountryCode::AN, // 289
    IsoCountryCode::AN, // 290
    IsoCountryCode::AN, // 291
    IsoCountryCode::AN, // 292
    IsoCountryCode::AN, // 293
    IsoCountryCode::LI, // 294 - LI
    IsoCountryCode::AN, // 295
    IsoCountryCode::LK, // 296 - LK
    IsoCountryCode::AN, // 297
    IsoCountryCode::AN, // 298
    IsoCountryCode::AN, // 299
    IsoCountryCode::AN, // 300
    IsoCountryCode::AN, // 301
    IsoCountryCode::AN, // 302
    IsoCountryCode::LR, // 303 - LR
    IsoCountryCode::LS, // 304 - LS
    IsoCountryCode::LT, // 305 - LT
    IsoCountryCode::LU, // 306 - LU
    IsoCountryCode::LV, // 307 - LV
    IsoCountryCode::AN, // 308
    IsoCountryCode::AN, // 309
    IsoCountryCode::LY, // 310 - LY
    IsoCountryCode::AN, // 311
    IsoCountryCode::MA, // 312 - MA
    IsoCountryCode::AN, // 313
    IsoCountryCode::MC, // 314 - MC
    IsoCountryCode::MD, // 315 - MD
    IsoCountryCode::ME, // 316 - ME
    IsoCountryCode::MF, // 317 - MF
    IsoCountryCode::MG, // 318 - MG
    IsoCountryCode::MH, // 319 - MH
    IsoCountryCode::AN, // 320
    IsoCountryCode::AN, // 321
    IsoCountryCode::MK, // 322 - MK
    IsoCountryCode::ML, // 323 - ML
    IsoCountryCode::MM, // 324 - MM
    IsoCountryCode::MN, // 325 - MN
    IsoCountryCode::MO, // 326 - MO
    IsoCountryCode::MP, // 327 - MP
    IsoCountryCode::MQ, // 328 - MQ
    IsoCountryCode::MR, // 329 - MR
    IsoCountryCode::MS, // 330 - MS
    IsoCountryCode::MT, // 331 - MT
    IsoCountryCode::MU, // 332 - MU
    IsoCountryCode::MV, // 333 - MV
    IsoCountryCode::MW, // 334 - MW
    IsoCountryCode::MX, // 335 - MX
    IsoCountryCode::MY, // 336 - MY
    IsoCountryCode::MZ, // 337 - MZ
    IsoCountryCode::NA, // 338 - NA
    IsoCountryCode::AN, // 339
    IsoCountryCode::NC, // 340 - NC
    IsoCountryCode::AN, // 341
    IsoCountryCode::NE, // 342 - NE
    IsoCountryCode::NF, // 343 - NF
    IsoCountryCode::NG, // 344 - NG
    IsoCountryCode::AN, // 345
    IsoCountryCode::NI, // 346 - NI
    IsoCountryCode::AN, // 347
    IsoCountryCode::AN, // 348
    IsoCountryCode::NL, // 349 - NL
    IsoCountryCode::AN, // 350
    IsoCountryCode::AN, // 351
    IsoCountryCode::NO, // 352 - NO
    IsoCountryCode::NP, // 353 - NP
    IsoCountryCode::AN, // 354
    IsoCountryCode::NR, // 355 - NR
    IsoCountryCode::AN, // 356
    IsoCountryCode::AN, // 357
    IsoCountryCode::NU, // 358 - NU
    IsoCountryCode::AN, // 359
    IsoCountryCode::AN, // 360
    IsoCountryCode::AN, // 361
    IsoCountryCode::AN, // 362
    IsoCountryCode::NZ, // 363 - NZ
    IsoCountryCode::AN, // 364
    IsoCountryCode::AN, // 365
    IsoCountryCode::AN, // 366
    IsoCountryCode::AN, // 367
    IsoCountryCode::AN, // 368
    IsoCountryCode::AN, // 369
    IsoCountryCode::AN, // 370
    IsoCountryCode::AN, // 371
    IsoCountryCode::AN, // 372
    IsoCountryCode::AN, // 373
    IsoCountryCode::AN, // 374
    IsoCountryCode::AN, // 375
    IsoCountryCode::OM, // 376 - OM
    IsoCountryCode::AN, // 377
    IsoCountryCode::AN, // 378
    IsoCountryCode::AN, // 379
    IsoCountryCode::AN, // 380
    IsoCountryCode::AN, // 381
    IsoCountryCode::AN, // 382
    IsoCountryCode::AN, // 383
    IsoCountryCode::AN, // 384
    IsoCountryCode::AN, // 385
    IsoCountryCode::AN, // 386
    IsoCountryCode::AN, // 387
    IsoCountryCode::AN, // 388
    IsoCountryCode::AN, // 389
    IsoCountryCode::PA, // 390 - PA
    IsoCountryCode::AN, // 391
    IsoCountryCode::AN, // 392
    IsoCountryCode::AN, // 393
    IsoCountryCode::PE, // 394 - PE
    IsoCountryCode::PF, // 395 - PF
    IsoCountryCode::PG, // 396 - PG
    IsoCountryCode::PH, // 397 - PH
    IsoCountryCode::AN, // 398
    IsoCountryCode::AN, // 399
    IsoCountryCode::PK, // 400 - PK
    IsoCountryCode::PL, // 401 - PL
    IsoCountryCode::PM, // 402 - PM
    IsoCountryCode::PN, // 403 - PN
    IsoCountryCode::AN, // 404
    IsoCountryCode::AN, // 405
    IsoCountryCode::AN, // 406
    IsoCountryCode::PR, // 407 - PR
    IsoCountryCode::PS, // 408 - PS
    IsoCountryCode::PT, // 409 - PT
    IsoCountryCode::AN, // 410
    IsoCountryCode::AN, // 411
    IsoCountryCode::PW, // 412 - PW
    IsoCountryCode::AN, // 413
    IsoCountryCode::PY, // 414 - PY
    IsoCountryCode::AN, // 415
    IsoCountryCode::QA, // 416 - QA
    IsoCountryCode::AN, // 417
    IsoCountryCode::AN, // 418
    IsoCountryCode::AN, // 419
    IsoCountryCode::AN, // 420
    IsoCountryCode::AN, // 421
    IsoCountryCode::AN, // 422
    IsoCountryCode::AN, // 423
    IsoCountryCode::AN, // 424
    IsoCountryCode::AN, // 425
    IsoCountryCode::AN, // 426
    IsoCountryCode::AN, // 427
    IsoCountryCode::AN, // 428
    IsoCountryCode::AN, // 429
    IsoCountryCode::AN, // 430
    IsoCountryCode::AN, // 431
    IsoCountryCode::AN, // 432
    IsoCountryCode::AN, // 433
    IsoCountryCode::AN, // 434
    IsoCountryCode::AN, // 435
    IsoCountryCode::AN, // 436
    IsoCountryCode::AN, // 437
    IsoCountryCode::AN, // 438
    IsoCountryCode::AN, // 439
    IsoCountryCode::AN, // 440
    IsoCountryCode::AN, // 441
    IsoCountryCode::AN, // 442
    IsoCountryCode::AN, // 443
    IsoCountryCode::AN, // 444
    IsoCountryCode::AN, // 445
    IsoCountryCode::RE, // 446 - RE
    IsoCountryCode::AN, // 447
    IsoCountryCode::AN, // 448
    IsoCountryCode::AN, // 449
    IsoCountryCode::AN, // 450
    IsoCountryCode::AN, // 451
    IsoCountryCode::AN, // 452
    IsoCountryCode::AN, // 453
    IsoCountryCode::AN, // 454
    IsoCountryCode::AN, // 455
    IsoCountryCode::RO, // 456 - RO
    IsoCountryCode::AN, // 457
    IsoCountryCode::AN, // 458
    IsoCountryCode::AN, // 459
    IsoCountryCode::RS, // 460 - RS
    IsoCountryCode::AN, // 461
    IsoCountryCode::RU, // 462 - RU
    IsoCountryCode::AN, // 463
    IsoCountryCode::RW, // 464 - RW
    IsoCountryCode::AN, // 465
    IsoCountryCode::AN, // 466
    IsoCountryCode::AN, // 467
    IsoCountryCode::SA, // 468 - SA
    IsoCountryCode::SB, // 469 - SB
    IsoCountryCode::SC, // 470 - SC
    IsoCountryCode::SD, // 471 - SD
    IsoCountryCode::SE, // 472 - SE
    IsoCountryCode::AN, // 473
    IsoCountryCode::SG, // 474 - SG
    IsoCountryCode::SH, // 475 - SH
    IsoCountryCode::SI, // 476 - SI
    IsoCountryCode::SJ, // 477 - SJ
    IsoCountryCode::SK, // 478 - SK
    IsoCountryCode::SL, // 479 - SL
    IsoCountryCode::SM, // 480 - SM
    IsoCountryCode::SN, // 481 - SN
    IsoCountryCode::SO, // 482 - SO
    IsoCountryCode::AN, // 483
    IsoCountryCode::AN, // 484
    IsoCountryCode::SR, // 485 - SR
    IsoCountryCode::SS, // 486 - SS
    IsoCountryCode::ST, // 487 - ST
    IsoCountryCode::AN, // 488
    IsoCountryCode::SV, // 489 - SV
    IsoCountryCode::AN, // 490
    IsoCountryCode::SX, // 491 - SX
    IsoCountryCode::SY, // 492 - SY
    IsoCountryCode::SZ, // 493 - SZ
    IsoCountryCode::AN, // 494
    IsoCountryCode::AN, // 495
    IsoCountryCode::TC, // 496 - TC
    IsoCountryCode::TD, // 497 - TD
    IsoCountryCode::AN, // 498
    IsoCountryCode::TF, // 499 - TF
    IsoCountryCode::TG, // 500 - TG
    IsoCountryCode::TH, // 501 - TH
    IsoCountryCode::AN, // 502
    IsoCountryCode::TJ, // 503 - TJ
    IsoCountryCode::TK, // 504 - TK
    IsoCountryCode::TL, // 505 - TL
    IsoCountryCode::TM, // 506 - TM
    IsoCountryCode::TN, // 507 - TN
    IsoCountryCode::TO, // 508 - TO
    IsoCountryCode::AN, // 509
    IsoCountryCode::AN, // 510
    IsoCountryCode::TR, // 511 - TR
    IsoCountryCode::AN, // 512
    IsoCountryCode::TT, // 513 - TT
    IsoCountryCode::AN, // 514
    IsoCountryCode::TV, // 515 - TV
    IsoCountryCode::TW, // 516 - TW
    IsoCountryCode::AN, // 517
    IsoCountryCode::AN, // 518
    IsoCountryCode::TZ, // 519 - TZ
    IsoCountryCode::UA, // 520 - UA
    IsoCountryCode::AN, // 521
    IsoCountryCode::AN, // 522
    IsoCountryCode::AN, // 523
    IsoCountryCode::AN, // 524
    IsoCountryCode::AN, // 525
    IsoCountryCode::UG, // 526 - UG
    IsoCountryCode::AN, // 527
    IsoCountryCode::AN, // 528
    IsoCountryCode::AN, // 529
    IsoCountryCode::AN, // 530
    IsoCountryCode::AN, // 531
    IsoCountryCode::UM, // 532 - UM
    IsoCountryCode::AN, // 533
    IsoCountryCode::AN, // 534
    IsoCountryCode::AN, // 535
    IsoCountryCode::AN, // 536
    IsoCountryCode::AN, // 537
    IsoCountryCode::US, // 538 - US
    IsoCountryCode::AN, // 539
    IsoCountryCode::AN, // 540
    IsoCountryCode::AN, // 541
    IsoCountryCode::AN, // 542
    IsoCountryCode::AN, // 543
    IsoCountryCode::UY, // 544 - UY
    IsoCountryCode::UZ, // 545 - UZ
    IsoCountryCode::VA, // 546 - VA
    IsoCountryCode::AN, // 547
    IsoCountryCode::VC, // 548 - VC
    IsoCountryCode::AN, // 549
    IsoCountryCode::VE, // 550 - VE
    IsoCountryCode::AN, // 551
    IsoCountryCode::VG, // 552 - VG
    IsoCountryCode::AN, // 553
    IsoCountryCode::VI, // 554 - VI
    IsoCountryCode::AN, // 555
    IsoCountryCode::AN, // 556
    IsoCountryCode::AN, // 557
    IsoCountryCode::AN, // 558
    IsoCountryCode::VN, // 559 - VN
    IsoCountryCode::AN, // 560
    IsoCountryCode::AN, // 561
    IsoCountryCode::AN, // 562
    IsoCountryCode::AN, // 563
    IsoCountryCode::AN, // 564
    IsoCountryCode::AN, // 565
    IsoCountryCode::VU, // 566 - VU
    IsoCountryCode::AN, // 567
    IsoCountryCode::AN, // 568
    IsoCountryCode::AN, // 569
    IsoCountryCode::AN, // 570
    IsoCountryCode::AN, // 571
    IsoCountryCode::AN, // 572
    IsoCountryCode::AN, // 573
    IsoCountryCode::AN, // 574
    IsoCountryCode::AN, // 575
    IsoCountryCode::AN, // 576
    IsoCountryCode::WF, // 577 - WF
    IsoCountryCode::AN, // 578
    IsoCountryCode::AN, // 579
    IsoCountryCode::AN, // 580
    IsoCountryCode::AN, // 581
    IsoCountryCode::AN, // 582
    IsoCountryCode::AN, // 583
    IsoCountryCode::AN, // 584
    IsoCountryCode::AN, // 585
    IsoCountryCode::AN, // 586
    IsoCountryCode::AN, // 587
    IsoCountryCode::AN, // 588
    IsoCountryCode::AN, // 589
    IsoCountryCode::WS, // 590 - WS
    IsoCountryCode::AN, // 591
    IsoCountryCode::AN, // 592
    IsoCountryCode::AN, // 593
    IsoCountryCode::AN, // 594
    IsoCountryCode::AN, // 595
    IsoCountryCode::AN, // 596
    IsoCountryCode::AN, // 597
    IsoCountryCode::AN, // 598
    IsoCountryCode::AN, // 599
    IsoCountryCode::AN, // 600
    IsoCountryCode::AN, // 601
    IsoCountryCode::AN, // 602
    IsoCountryCode::AN, // 603
    IsoCountryCode::AN, // 604
    IsoCountryCode::AN, // 605
    IsoCountryCode::AN, // 606
    IsoCountryCode::AN, // 607
    IsoCountryCode::XK, // 608 - XK
    IsoCountryCode::AN, // 609
    IsoCountryCode::AN, // 610
    IsoCountryCode::AN, // 611
    IsoCountryCode::AN, // 612
    IsoCountryCode::AN, // 613
    IsoCountryCode::AN, // 614
    IsoCountryCode::AN, // 615
    IsoCountryCode::AN, // 616
    IsoCountryCode::AN, // 617
    IsoCountryCode::AN, // 618
    IsoCountryCode::AN, // 619
    IsoCountryCode::AN, // 620
    IsoCountryCode::AN, // 621
    IsoCountryCode::AN, // 622
    IsoCountryCode::AN, // 623
    IsoCountryCode::AN, // 624
    IsoCountryCode::AN, // 625
    IsoCountryCode::AN, // 626
    IsoCountryCode::AN, // 627
    IsoCountryCode::YE, // 628 - YE
    IsoCountryCode::AN, // 629
    IsoCountryCode::AN, // 630
    IsoCountryCode::AN, // 631
    IsoCountryCode::AN, // 632
    IsoCountryCode::AN, // 633
    IsoCountryCode::AN, // 634
    IsoCountryCode::AN, // 635
    IsoCountryCode::AN, // 636
    IsoCountryCode::AN, // 637
    IsoCountryCode::AN, // 638
    IsoCountryCode::AN, // 639
    IsoCountryCode::AN, // 640
    IsoCountryCode::AN, // 641
    IsoCountryCode::AN, // 642
    IsoCountryCode::YT, // 643 - YT
    IsoCountryCode::AN, // 644
    IsoCountryCode::AN, // 645
    IsoCountryCode::AN, // 646
    IsoCountryCode::AN, // 647
    IsoCountryCode::AN, // 648
    IsoCountryCode::AN, // 649
    IsoCountryCode::ZA, // 650 - ZA
    IsoCountryCode::AN, // 651
    IsoCountryCode::AN, // 652
    IsoCountryCode::AN, // 653
    IsoCountryCode::AN, // 654
    IsoCountryCode::AN, // 655
    IsoCountryCode::AN, // 656
    IsoCountryCode::AN, // 657
    IsoCountryCode::AN, // 658
    IsoCountryCode::AN, // 659
    IsoCountryCode::AN, // 660
    IsoCountryCode::AN, // 661
    IsoCountryCode::ZM, // 662 - ZM
    IsoCountryCode::AN, // 663
    IsoCountryCode::AN, // 664
    IsoCountryCode::AN, // 665
    IsoCountryCode::AN, // 666
    IsoCountryCode::AN, // 667
    IsoCountryCode::AN, // 668
    IsoCountryCode::AN, // 669
    IsoCountryCode::AN, // 670
    IsoCountryCode::AN, // 671
    IsoCountryCode::ZW, // 672 - ZW
    IsoCountryCode::AN, // 673
    IsoCountryCode::AN, // 674
    IsoCountryCode::AN, // 675
];

#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[repr(u16)]
pub enum IsoCountryCode {
    AD, /* AND - Andorra */
    AE, /* ARE - United Arab Emirates */
    AF, /* AFG - Afghanistan */
    AG, /* ATG - Antigua and Barbuda */
    AI, /* AIA - Anguilla */
    AL, /* ALB - Albania */
    AM, /* ARM - Armenia */
    AO, /* AGO - Angola */
    AQ, /* ATA - Antarctica */
    AR, /* ARG - Argentina */
    AS, /* ASM - American Samoa */
    AT, /* AUT - Austria */
    AU, /* AUS - Australia */
    AW, /* ABW - Aruba */
    AX, /* ALA - Aland Islands */
    AZ, /* AZE - Azerbaijan */
    BA, /* BIH - Bosnia and Herzegovina */
    BB, /* BRB - Barbados */
    BD, /* BGD - Bangladesh */
    BE, /* BEL - Belgium */
    BF, /* BFA - Burkina Faso */
    BG, /* BGR - Bulgaria */
    BH, /* BHR - Bahrain */
    BI, /* BDI - Burundi */
    BJ, /* BEN - Benin */
    BL, /* BLM - Saint Barthelemy */
    BM, /* BMU - Bermuda */
    BN, /* BRN - Brunei */
    BO, /* BOL - Bolivia */
    BQ, /* BES - Bonaire, Saint Eustatius and Saba  */
    BR, /* BRA - Brazil */
    BS, /* BHS - Bahamas */
    BT, /* BTN - Bhutan */
    BV, /* BVT - Bouvet Island */
    BW, /* BWA - Botswana */
    BY, /* BLR - Belarus */
    BZ, /* BLZ - Belize */
    CA, /* CAN - Canada */
    CC, /* CCK - Cocos Islands */
    CD, /* COD - Democratic Republic of the Congo */
    CF, /* CAF - Central African Republic */
    CG, /* COG - Republic of the Congo */
    CH, /* CHE - Switzerland */
    CI, /* CIV - Ivory Coast */
    CK, /* COK - Cook Islands */
    CL, /* CHL - Chile */
    CM, /* CMR - Cameroon */
    CN, /* CHN - China */
    CO, /* COL - Colombia */
    CR, /* CRI - Costa Rica */
    CU, /* CUB - Cuba */
    CV, /* CPV - Cabo Verde */
    CW, /* CUW - Curacao */
    CX, /* CXR - Christmas Island */
    CY, /* CYP - Cyprus */
    CZ, /* CZE - Czechia */
    DE, /* DEU - Germany */
    DJ, /* DJI - Djibouti */
    DK, /* DNK - Denmark */
    DM, /* DMA - Dominica */
    DO, /* DOM - Dominican Republic */
    DZ, /* DZA - Algeria */
    EC, /* ECU - Ecuador */
    EE, /* EST - Estonia */
    EG, /* EGY - Egypt */
    EH, /* ESH - Western Sahara */
    ER, /* ERI - Eritrea */
    ES, /* ESP - Spain */
    ET, /* ETH - Ethiopia */
    FI, /* FIN - Finland */
    FJ, /* FJI - Fiji */
    FK, /* FLK - Falkland Islands */
    FM, /* FSM - Micronesia */
    FO, /* FRO - Faroe Islands */
    FR, /* FRA - France */
    GA, /* GAB - Gabon */
    GB, /* GBR - United Kingdom */
    GD, /* GRD - Grenada */
    GE, /* GEO - Georgia */
    GF, /* GUF - French Guiana */
    GG, /* GGY - Guernsey */
    GH, /* GHA - Ghana */
    GI, /* GIB - Gibraltar */
    GL, /* GRL - Greenland */
    GM, /* GMB - Gambia */
    GN, /* GIN - Guinea */
    GP, /* GLP - Guadeloupe */
    GQ, /* GNQ - Equatorial Guinea */
    GR, /* GRC - Greece */
    GS, /* SGS - South Georgia and the South Sandwich Islands */
    GT, /* GTM - Guatemala */
    GU, /* GUM - Guam */
    GW, /* GNB - Guinea-Bissau */
    GY, /* GUY - Guyana */
    HK, /* HKG - Hong Kong */
    HM, /* HMD - Heard Island and McDonald Islands */
    HN, /* HND - Honduras */
    HR, /* HRV - Croatia */
    HT, /* HTI - Haiti */
    HU, /* HUN - Hungary */
    ID, /* IDN - Indonesia */
    IE, /* IRL - Ireland */
    IL, /* ISR - Israel */
    IM, /* IMN - Isle of Man */
    IN, /* IND - India */
    IO, /* IOT - British Indian Ocean Territory */
    IQ, /* IRQ - Iraq */
    IR, /* IRN - Iran */
    IS, /* ISL - Iceland */
    IT, /* ITA - Italy */
    JE, /* JEY - Jersey */
    JM, /* JAM - Jamaica */
    JO, /* JOR - Jordan */
    JP, /* JPN - Japan */
    KE, /* KEN - Kenya */
    KG, /* KGZ - Kyrgyzstan */
    KH, /* KHM - Cambodia */
    KI, /* KIR - Kiribati */
    KM, /* COM - Comoros */
    KN, /* KNA - Saint Kitts and Nevis */
    KP, /* PRK - North Korea */
    KR, /* KOR - South Korea */
    XK, /* XKX - Kosovo */
    KW, /* KWT - Kuwait */
    KY, /* CYM - Cayman Islands */
    KZ, /* KAZ - Kazakhstan */
    LA, /* LAO - Laos */
    LB, /* LBN - Lebanon */
    LC, /* LCA - Saint Lucia */
    LI, /* LIE - Liechtenstein */
    LK, /* LKA - Sri Lanka */
    LR, /* LBR - Liberia */
    LS, /* LSO - Lesotho */
    LT, /* LTU - Lithuania */
    LU, /* LUX - Luxembourg */
    LV, /* LVA - Latvia */
    LY, /* LBY - Libya */
    MA, /* MAR - Morocco */
    MC, /* MCO - Monaco */
    MD, /* MDA - Moldova */
    ME, /* MNE - Montenegro */
    MF, /* MAF - Saint Martin */
    MG, /* MDG - Madagascar */
    MH, /* MHL - Marshall Islands */
    MK, /* MKD - North Macedonia */
    ML, /* MLI - Mali */
    MM, /* MMR - Myanmar */
    MN, /* MNG - Mongolia */
    MO, /* MAC - Macao */
    MP, /* MNP - Northern Mariana Islands */
    MQ, /* MTQ - Martinique */
    MR, /* MRT - Mauritania */
    MS, /* MSR - Montserrat */
    MT, /* MLT - Malta */
    MU, /* MUS - Mauritius */
    MV, /* MDV - Maldives */
    MW, /* MWI - Malawi */
    MX, /* MEX - Mexico */
    MY, /* MYS - Malaysia */
    MZ, /* MOZ - Mozambique */
    NA, /* NAM - Namibia */
    NC, /* NCL - New Caledonia */
    NE, /* NER - Niger */
    NF, /* NFK - Norfolk Island */
    NG, /* NGA - Nigeria */
    NI, /* NIC - Nicaragua */
    NL, /* NLD - The Netherlands */
    NO, /* NOR - Norway */
    NP, /* NPL - Nepal */
    NR, /* NRU - Nauru */
    NU, /* NIU - Niue */
    NZ, /* NZL - New Zealand */
    OM, /* OMN - Oman */
    PA, /* PAN - Panama */
    PE, /* PER - Peru */
    PF, /* PYF - French Polynesia */
    PG, /* PNG - Papua New Guinea */
    PH, /* PHL - Philippines */
    PK, /* PAK - Pakistan */
    PL, /* POL - Poland */
    PM, /* SPM - Saint Pierre and Miquelon */
    PN, /* PCN - Pitcairn */
    PR, /* PRI - Puerto Rico */
    PS, /* PSE - Palestinian Territory */
    PT, /* PRT - Portugal */
    PW, /* PLW - Palau */
    PY, /* PRY - Paraguay */
    QA, /* QAT - Qatar */
    RE, /* REU - Reunion */
    RO, /* ROU - Romania */
    RS, /* SRB - Serbia */
    RU, /* RUS - Russia */
    RW, /* RWA - Rwanda */
    SA, /* SAU - Saudi Arabia */
    SB, /* SLB - Solomon Islands */
    SC, /* SYC - Seychelles */
    SD, /* SDN - Sudan */
    SS, /* SSD - South Sudan */
    SE, /* SWE - Sweden */
    SG, /* SGP - Singapore */
    SH, /* SHN - Saint Helena */
    SI, /* SVN - Slovenia */
    SJ, /* SJM - Svalbard and Jan Mayen */
    SK, /* SVK - Slovakia */
    SL, /* SLE - Sierra Leone */
    SM, /* SMR - San Marino */
    SN, /* SEN - Senegal */
    SO, /* SOM - Somalia */
    SR, /* SUR - Suriname */
    ST, /* STP - Sao Tome and Principe */
    SV, /* SLV - El Salvador */
    SX, /* SXM - Sint Maarten */
    SY, /* SYR - Syria */
    SZ, /* SWZ - Eswatini */
    TC, /* TCA - Turks and Caicos Islands */
    TD, /* TCD - Chad */
    TF, /* ATF - French Southern Territories */
    TG, /* TGO - Togo */
    TH, /* THA - Thailand */
    TJ, /* TJK - Tajikistan */
    TK, /* TKL - Tokelau */
    TL, /* TLS - Timor Leste */
    TM, /* TKM - Turkmenistan */
    TN, /* TUN - Tunisia */
    TO, /* TON - Tonga */
    TR, /* TUR - Turkey */
    TT, /* TTO - Trinidad and Tobago */
    TV, /* TUV - Tuvalu */
    TW, /* TWN - Taiwan */
    TZ, /* TZA - Tanzania */
    UA, /* UKR - Ukraine */
    UG, /* UGA - Uganda */
    UM, /* UMI - United States Minor Outlying Islands */
    US, /* USA - United States */
    UY, /* URY - Uruguay */
    UZ, /* UZB - Uzbekistan */
    VA, /* VAT - Vatican */
    VC, /* VCT - Saint Vincent and the Grenadines */
    VE, /* VEN - Venezuela */
    VG, /* VGB - British Virgin Islands */
    VI, /* VIR - U.S. Virgin Islands */
    VN, /* VNM - Vietnam */
    VU, /* VUT - Vanuatu */
    WF, /* WLF - Wallis and Futuna */
    WS, /* WSM - Samoa */
    YE, /* YEM - Yemen */
    YT, /* MYT - Mayotte */
    ZA, /* ZAF - South Africa */
    ZM, /* ZMB - Zambia */
    ZW, /* ZWE - Zimbabwe */
    CS, /* SCG - Serbia and Montenegro */
    AN, /* ANT - Netherlands Antilles */
}

impl IsoCountryCode {
    pub fn name(&self) -> &'static str {
        ALL_COUNTRY_NAMES[*self as usize]
    }

    pub fn alpha2_code(&self) -> &'static str {
        ALL_ALPHA2_CODES[*self as usize]
    }

    pub fn alpha3_code(&self) -> &'static str {
        ALL_ALPHA3_CODES[*self as usize]
    }

    pub fn variant_count() -> usize {
        Self::AN as usize
    }

    pub fn continent(&self) -> ContinentCode {
        match self {
            IsoCountryCode::AD => ContinentCode::EU,
            IsoCountryCode::AE => ContinentCode::AS,
            IsoCountryCode::AF => ContinentCode::AS,
            IsoCountryCode::AG => ContinentCode::NA,
            IsoCountryCode::AI => ContinentCode::NA,
            IsoCountryCode::AL => ContinentCode::EU,
            IsoCountryCode::AM => ContinentCode::AS,
            IsoCountryCode::AO => ContinentCode::AF,
            IsoCountryCode::AQ => ContinentCode::AN,
            IsoCountryCode::AR => ContinentCode::SA,
            IsoCountryCode::AS => ContinentCode::OC,
            IsoCountryCode::AT => ContinentCode::EU,
            IsoCountryCode::AU => ContinentCode::OC,
            IsoCountryCode::AW => ContinentCode::NA,
            IsoCountryCode::AX => ContinentCode::EU,
            IsoCountryCode::AZ => ContinentCode::AS,
            IsoCountryCode::BA => ContinentCode::EU,
            IsoCountryCode::BB => ContinentCode::NA,
            IsoCountryCode::BD => ContinentCode::AS,
            IsoCountryCode::BE => ContinentCode::EU,
            IsoCountryCode::BF => ContinentCode::AF,
            IsoCountryCode::BG => ContinentCode::EU,
            IsoCountryCode::BH => ContinentCode::AS,
            IsoCountryCode::BI => ContinentCode::AF,
            IsoCountryCode::BJ => ContinentCode::AF,
            IsoCountryCode::BL => ContinentCode::NA,
            IsoCountryCode::BM => ContinentCode::NA,
            IsoCountryCode::BN => ContinentCode::AS,
            IsoCountryCode::BO => ContinentCode::SA,
            IsoCountryCode::BQ => ContinentCode::NA,
            IsoCountryCode::BR => ContinentCode::SA,
            IsoCountryCode::BS => ContinentCode::NA,
            IsoCountryCode::BT => ContinentCode::AS,
            IsoCountryCode::BV => ContinentCode::AN,
            IsoCountryCode::BW => ContinentCode::AF,
            IsoCountryCode::BY => ContinentCode::EU,
            IsoCountryCode::BZ => ContinentCode::NA,
            IsoCountryCode::CA => ContinentCode::NA,
            IsoCountryCode::CC => ContinentCode::AS,
            IsoCountryCode::CD => ContinentCode::AF,
            IsoCountryCode::CF => ContinentCode::AF,
            IsoCountryCode::CG => ContinentCode::AF,
            IsoCountryCode::CH => ContinentCode::EU,
            IsoCountryCode::CI => ContinentCode::AF,
            IsoCountryCode::CK => ContinentCode::OC,
            IsoCountryCode::CL => ContinentCode::SA,
            IsoCountryCode::CM => ContinentCode::AF,
            IsoCountryCode::CN => ContinentCode::AS,
            IsoCountryCode::CO => ContinentCode::SA,
            IsoCountryCode::CR => ContinentCode::NA,
            IsoCountryCode::CU => ContinentCode::NA,
            IsoCountryCode::CV => ContinentCode::AF,
            IsoCountryCode::CW => ContinentCode::NA,
            IsoCountryCode::CX => ContinentCode::OC,
            IsoCountryCode::CY => ContinentCode::EU,
            IsoCountryCode::CZ => ContinentCode::EU,
            IsoCountryCode::DE => ContinentCode::EU,
            IsoCountryCode::DJ => ContinentCode::AF,
            IsoCountryCode::DK => ContinentCode::EU,
            IsoCountryCode::DM => ContinentCode::NA,
            IsoCountryCode::DO => ContinentCode::NA,
            IsoCountryCode::DZ => ContinentCode::AF,
            IsoCountryCode::EC => ContinentCode::SA,
            IsoCountryCode::EE => ContinentCode::EU,
            IsoCountryCode::EG => ContinentCode::AF,
            IsoCountryCode::EH => ContinentCode::AF,
            IsoCountryCode::ER => ContinentCode::AF,
            IsoCountryCode::ES => ContinentCode::EU,
            IsoCountryCode::ET => ContinentCode::AF,
            IsoCountryCode::FI => ContinentCode::EU,
            IsoCountryCode::FJ => ContinentCode::OC,
            IsoCountryCode::FK => ContinentCode::SA,
            IsoCountryCode::FM => ContinentCode::OC,
            IsoCountryCode::FO => ContinentCode::EU,
            IsoCountryCode::FR => ContinentCode::EU,
            IsoCountryCode::GA => ContinentCode::AF,
            IsoCountryCode::GB => ContinentCode::EU,
            IsoCountryCode::GD => ContinentCode::NA,
            IsoCountryCode::GE => ContinentCode::AS,
            IsoCountryCode::GF => ContinentCode::SA,
            IsoCountryCode::GG => ContinentCode::EU,
            IsoCountryCode::GH => ContinentCode::AF,
            IsoCountryCode::GI => ContinentCode::EU,
            IsoCountryCode::GL => ContinentCode::NA,
            IsoCountryCode::GM => ContinentCode::AF,
            IsoCountryCode::GN => ContinentCode::AF,
            IsoCountryCode::GP => ContinentCode::NA,
            IsoCountryCode::GQ => ContinentCode::AF,
            IsoCountryCode::GR => ContinentCode::EU,
            IsoCountryCode::GS => ContinentCode::AN,
            IsoCountryCode::GT => ContinentCode::NA,
            IsoCountryCode::GU => ContinentCode::OC,
            IsoCountryCode::GW => ContinentCode::AF,
            IsoCountryCode::GY => ContinentCode::SA,
            IsoCountryCode::HK => ContinentCode::AS,
            IsoCountryCode::HM => ContinentCode::AN,
            IsoCountryCode::HN => ContinentCode::NA,
            IsoCountryCode::HR => ContinentCode::EU,
            IsoCountryCode::HT => ContinentCode::NA,
            IsoCountryCode::HU => ContinentCode::EU,
            IsoCountryCode::ID => ContinentCode::AS,
            IsoCountryCode::IE => ContinentCode::EU,
            IsoCountryCode::IL => ContinentCode::AS,
            IsoCountryCode::IM => ContinentCode::EU,
            IsoCountryCode::IN => ContinentCode::AS,
            IsoCountryCode::IO => ContinentCode::AS,
            IsoCountryCode::IQ => ContinentCode::AS,
            IsoCountryCode::IR => ContinentCode::AS,
            IsoCountryCode::IS => ContinentCode::EU,
            IsoCountryCode::IT => ContinentCode::EU,
            IsoCountryCode::JE => ContinentCode::EU,
            IsoCountryCode::JM => ContinentCode::NA,
            IsoCountryCode::JO => ContinentCode::AS,
            IsoCountryCode::JP => ContinentCode::AS,
            IsoCountryCode::KE => ContinentCode::AF,
            IsoCountryCode::KG => ContinentCode::AS,
            IsoCountryCode::KH => ContinentCode::AS,
            IsoCountryCode::KI => ContinentCode::OC,
            IsoCountryCode::KM => ContinentCode::AF,
            IsoCountryCode::KN => ContinentCode::NA,
            IsoCountryCode::KP => ContinentCode::AS,
            IsoCountryCode::KR => ContinentCode::AS,
            IsoCountryCode::XK => ContinentCode::EU,
            IsoCountryCode::KW => ContinentCode::AS,
            IsoCountryCode::KY => ContinentCode::NA,
            IsoCountryCode::KZ => ContinentCode::AS,
            IsoCountryCode::LA => ContinentCode::AS,
            IsoCountryCode::LB => ContinentCode::AS,
            IsoCountryCode::LC => ContinentCode::NA,
            IsoCountryCode::LI => ContinentCode::EU,
            IsoCountryCode::LK => ContinentCode::AS,
            IsoCountryCode::LR => ContinentCode::AF,
            IsoCountryCode::LS => ContinentCode::AF,
            IsoCountryCode::LT => ContinentCode::EU,
            IsoCountryCode::LU => ContinentCode::EU,
            IsoCountryCode::LV => ContinentCode::EU,
            IsoCountryCode::LY => ContinentCode::AF,
            IsoCountryCode::MA => ContinentCode::AF,
            IsoCountryCode::MC => ContinentCode::EU,
            IsoCountryCode::MD => ContinentCode::EU,
            IsoCountryCode::ME => ContinentCode::EU,
            IsoCountryCode::MF => ContinentCode::NA,
            IsoCountryCode::MG => ContinentCode::AF,
            IsoCountryCode::MH => ContinentCode::OC,
            IsoCountryCode::MK => ContinentCode::EU,
            IsoCountryCode::ML => ContinentCode::AF,
            IsoCountryCode::MM => ContinentCode::AS,
            IsoCountryCode::MN => ContinentCode::AS,
            IsoCountryCode::MO => ContinentCode::AS,
            IsoCountryCode::MP => ContinentCode::OC,
            IsoCountryCode::MQ => ContinentCode::NA,
            IsoCountryCode::MR => ContinentCode::AF,
            IsoCountryCode::MS => ContinentCode::NA,
            IsoCountryCode::MT => ContinentCode::EU,
            IsoCountryCode::MU => ContinentCode::AF,
            IsoCountryCode::MV => ContinentCode::AS,
            IsoCountryCode::MW => ContinentCode::AF,
            IsoCountryCode::MX => ContinentCode::NA,
            IsoCountryCode::MY => ContinentCode::AS,
            IsoCountryCode::MZ => ContinentCode::AF,
            IsoCountryCode::NA => ContinentCode::AF,
            IsoCountryCode::NC => ContinentCode::OC,
            IsoCountryCode::NE => ContinentCode::AF,
            IsoCountryCode::NF => ContinentCode::OC,
            IsoCountryCode::NG => ContinentCode::AF,
            IsoCountryCode::NI => ContinentCode::NA,
            IsoCountryCode::NL => ContinentCode::EU,
            IsoCountryCode::NO => ContinentCode::EU,
            IsoCountryCode::NP => ContinentCode::AS,
            IsoCountryCode::NR => ContinentCode::OC,
            IsoCountryCode::NU => ContinentCode::OC,
            IsoCountryCode::NZ => ContinentCode::OC,
            IsoCountryCode::OM => ContinentCode::AS,
            IsoCountryCode::PA => ContinentCode::NA,
            IsoCountryCode::PE => ContinentCode::SA,
            IsoCountryCode::PF => ContinentCode::OC,
            IsoCountryCode::PG => ContinentCode::OC,
            IsoCountryCode::PH => ContinentCode::AS,
            IsoCountryCode::PK => ContinentCode::AS,
            IsoCountryCode::PL => ContinentCode::EU,
            IsoCountryCode::PM => ContinentCode::NA,
            IsoCountryCode::PN => ContinentCode::OC,
            IsoCountryCode::PR => ContinentCode::NA,
            IsoCountryCode::PS => ContinentCode::AS,
            IsoCountryCode::PT => ContinentCode::EU,
            IsoCountryCode::PW => ContinentCode::OC,
            IsoCountryCode::PY => ContinentCode::SA,
            IsoCountryCode::QA => ContinentCode::AS,
            IsoCountryCode::RE => ContinentCode::AF,
            IsoCountryCode::RO => ContinentCode::EU,
            IsoCountryCode::RS => ContinentCode::EU,
            IsoCountryCode::RU => ContinentCode::EU,
            IsoCountryCode::RW => ContinentCode::AF,
            IsoCountryCode::SA => ContinentCode::AS,
            IsoCountryCode::SB => ContinentCode::OC,
            IsoCountryCode::SC => ContinentCode::AF,
            IsoCountryCode::SD => ContinentCode::AF,
            IsoCountryCode::SS => ContinentCode::AF,
            IsoCountryCode::SE => ContinentCode::EU,
            IsoCountryCode::SG => ContinentCode::AS,
            IsoCountryCode::SH => ContinentCode::AF,
            IsoCountryCode::SI => ContinentCode::EU,
            IsoCountryCode::SJ => ContinentCode::EU,
            IsoCountryCode::SK => ContinentCode::EU,
            IsoCountryCode::SL => ContinentCode::AF,
            IsoCountryCode::SM => ContinentCode::EU,
            IsoCountryCode::SN => ContinentCode::AF,
            IsoCountryCode::SO => ContinentCode::AF,
            IsoCountryCode::SR => ContinentCode::SA,
            IsoCountryCode::ST => ContinentCode::AF,
            IsoCountryCode::SV => ContinentCode::NA,
            IsoCountryCode::SX => ContinentCode::NA,
            IsoCountryCode::SY => ContinentCode::AS,
            IsoCountryCode::SZ => ContinentCode::AF,
            IsoCountryCode::TC => ContinentCode::NA,
            IsoCountryCode::TD => ContinentCode::AF,
            IsoCountryCode::TF => ContinentCode::AN,
            IsoCountryCode::TG => ContinentCode::AF,
            IsoCountryCode::TH => ContinentCode::AS,
            IsoCountryCode::TJ => ContinentCode::AS,
            IsoCountryCode::TK => ContinentCode::OC,
            IsoCountryCode::TL => ContinentCode::OC,
            IsoCountryCode::TM => ContinentCode::AS,
            IsoCountryCode::TN => ContinentCode::AF,
            IsoCountryCode::TO => ContinentCode::OC,
            IsoCountryCode::TR => ContinentCode::AS,
            IsoCountryCode::TT => ContinentCode::NA,
            IsoCountryCode::TV => ContinentCode::OC,
            IsoCountryCode::TW => ContinentCode::AS,
            IsoCountryCode::TZ => ContinentCode::AF,
            IsoCountryCode::UA => ContinentCode::EU,
            IsoCountryCode::UG => ContinentCode::AF,
            IsoCountryCode::UM => ContinentCode::OC,
            IsoCountryCode::US => ContinentCode::NA,
            IsoCountryCode::UY => ContinentCode::SA,
            IsoCountryCode::UZ => ContinentCode::AS,
            IsoCountryCode::VA => ContinentCode::EU,
            IsoCountryCode::VC => ContinentCode::NA,
            IsoCountryCode::VE => ContinentCode::SA,
            IsoCountryCode::VG => ContinentCode::NA,
            IsoCountryCode::VI => ContinentCode::NA,
            IsoCountryCode::VN => ContinentCode::AS,
            IsoCountryCode::VU => ContinentCode::OC,
            IsoCountryCode::WF => ContinentCode::OC,
            IsoCountryCode::WS => ContinentCode::OC,
            IsoCountryCode::YE => ContinentCode::AS,
            IsoCountryCode::YT => ContinentCode::AF,
            IsoCountryCode::ZA => ContinentCode::AF,
            IsoCountryCode::ZM => ContinentCode::AF,
            IsoCountryCode::ZW => ContinentCode::AF,
            IsoCountryCode::CS => ContinentCode::EU,
            IsoCountryCode::AN => ContinentCode::NA,
        }
    }
}

impl fmt::Display for IsoCountryCode {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{}({})", self.alpha2_code(), self.name())
    }
}

impl FromStr for IsoCountryCode {
    type Err = ();

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s.len() {
            2 => {
                let s = s.to_uppercase();
                let s = s.as_bytes();
                let id = ((s[0] - b'A') as usize) * 26 + ((s[1] - b'A') as usize);
                Ok(ALPHA2_FAST_MAP[id])
            }
            3 => match s.to_uppercase().as_str() {
                "AND" => Ok(IsoCountryCode::AD),
                "ARE" => Ok(IsoCountryCode::AE),
                "AFG" => Ok(IsoCountryCode::AF),
                "ATG" => Ok(IsoCountryCode::AG),
                "AIA" => Ok(IsoCountryCode::AI),
                "ALB" => Ok(IsoCountryCode::AL),
                "ARM" => Ok(IsoCountryCode::AM),
                "AGO" => Ok(IsoCountryCode::AO),
                "ATA" => Ok(IsoCountryCode::AQ),
                "ARG" => Ok(IsoCountryCode::AR),
                "ASM" => Ok(IsoCountryCode::AS),
                "AUT" => Ok(IsoCountryCode::AT),
                "AUS" => Ok(IsoCountryCode::AU),
                "ABW" => Ok(IsoCountryCode::AW),
                "ALA" => Ok(IsoCountryCode::AX),
                "AZE" => Ok(IsoCountryCode::AZ),
                "BIH" => Ok(IsoCountryCode::BA),
                "BRB" => Ok(IsoCountryCode::BB),
                "BGD" => Ok(IsoCountryCode::BD),
                "BEL" => Ok(IsoCountryCode::BE),
                "BFA" => Ok(IsoCountryCode::BF),
                "BGR" => Ok(IsoCountryCode::BG),
                "BHR" => Ok(IsoCountryCode::BH),
                "BDI" => Ok(IsoCountryCode::BI),
                "BEN" => Ok(IsoCountryCode::BJ),
                "BLM" => Ok(IsoCountryCode::BL),
                "BMU" => Ok(IsoCountryCode::BM),
                "BRN" => Ok(IsoCountryCode::BN),
                "BOL" => Ok(IsoCountryCode::BO),
                "BES" => Ok(IsoCountryCode::BQ),
                "BRA" => Ok(IsoCountryCode::BR),
                "BHS" => Ok(IsoCountryCode::BS),
                "BTN" => Ok(IsoCountryCode::BT),
                "BVT" => Ok(IsoCountryCode::BV),
                "BWA" => Ok(IsoCountryCode::BW),
                "BLR" => Ok(IsoCountryCode::BY),
                "BLZ" => Ok(IsoCountryCode::BZ),
                "CAN" => Ok(IsoCountryCode::CA),
                "CCK" => Ok(IsoCountryCode::CC),
                "COD" => Ok(IsoCountryCode::CD),
                "CAF" => Ok(IsoCountryCode::CF),
                "COG" => Ok(IsoCountryCode::CG),
                "CHE" => Ok(IsoCountryCode::CH),
                "CIV" => Ok(IsoCountryCode::CI),
                "COK" => Ok(IsoCountryCode::CK),
                "CHL" => Ok(IsoCountryCode::CL),
                "CMR" => Ok(IsoCountryCode::CM),
                "CHN" => Ok(IsoCountryCode::CN),
                "COL" => Ok(IsoCountryCode::CO),
                "CRI" => Ok(IsoCountryCode::CR),
                "CUB" => Ok(IsoCountryCode::CU),
                "CPV" => Ok(IsoCountryCode::CV),
                "CUW" => Ok(IsoCountryCode::CW),
                "CXR" => Ok(IsoCountryCode::CX),
                "CYP" => Ok(IsoCountryCode::CY),
                "CZE" => Ok(IsoCountryCode::CZ),
                "DEU" => Ok(IsoCountryCode::DE),
                "DJI" => Ok(IsoCountryCode::DJ),
                "DNK" => Ok(IsoCountryCode::DK),
                "DMA" => Ok(IsoCountryCode::DM),
                "DOM" => Ok(IsoCountryCode::DO),
                "DZA" => Ok(IsoCountryCode::DZ),
                "ECU" => Ok(IsoCountryCode::EC),
                "EST" => Ok(IsoCountryCode::EE),
                "EGY" => Ok(IsoCountryCode::EG),
                "ESH" => Ok(IsoCountryCode::EH),
                "ERI" => Ok(IsoCountryCode::ER),
                "ESP" => Ok(IsoCountryCode::ES),
                "ETH" => Ok(IsoCountryCode::ET),
                "FIN" => Ok(IsoCountryCode::FI),
                "FJI" => Ok(IsoCountryCode::FJ),
                "FLK" => Ok(IsoCountryCode::FK),
                "FSM" => Ok(IsoCountryCode::FM),
                "FRO" => Ok(IsoCountryCode::FO),
                "FRA" => Ok(IsoCountryCode::FR),
                "GAB" => Ok(IsoCountryCode::GA),
                "GBR" => Ok(IsoCountryCode::GB),
                "GRD" => Ok(IsoCountryCode::GD),
                "GEO" => Ok(IsoCountryCode::GE),
                "GUF" => Ok(IsoCountryCode::GF),
                "GGY" => Ok(IsoCountryCode::GG),
                "GHA" => Ok(IsoCountryCode::GH),
                "GIB" => Ok(IsoCountryCode::GI),
                "GRL" => Ok(IsoCountryCode::GL),
                "GMB" => Ok(IsoCountryCode::GM),
                "GIN" => Ok(IsoCountryCode::GN),
                "GLP" => Ok(IsoCountryCode::GP),
                "GNQ" => Ok(IsoCountryCode::GQ),
                "GRC" => Ok(IsoCountryCode::GR),
                "SGS" => Ok(IsoCountryCode::GS),
                "GTM" => Ok(IsoCountryCode::GT),
                "GUM" => Ok(IsoCountryCode::GU),
                "GNB" => Ok(IsoCountryCode::GW),
                "GUY" => Ok(IsoCountryCode::GY),
                "HKG" => Ok(IsoCountryCode::HK),
                "HMD" => Ok(IsoCountryCode::HM),
                "HND" => Ok(IsoCountryCode::HN),
                "HRV" => Ok(IsoCountryCode::HR),
                "HTI" => Ok(IsoCountryCode::HT),
                "HUN" => Ok(IsoCountryCode::HU),
                "IDN" => Ok(IsoCountryCode::ID),
                "IRL" => Ok(IsoCountryCode::IE),
                "ISR" => Ok(IsoCountryCode::IL),
                "IMN" => Ok(IsoCountryCode::IM),
                "IND" => Ok(IsoCountryCode::IN),
                "IOT" => Ok(IsoCountryCode::IO),
                "IRQ" => Ok(IsoCountryCode::IQ),
                "IRN" => Ok(IsoCountryCode::IR),
                "ISL" => Ok(IsoCountryCode::IS),
                "ITA" => Ok(IsoCountryCode::IT),
                "JEY" => Ok(IsoCountryCode::JE),
                "JAM" => Ok(IsoCountryCode::JM),
                "JOR" => Ok(IsoCountryCode::JO),
                "JPN" => Ok(IsoCountryCode::JP),
                "KEN" => Ok(IsoCountryCode::KE),
                "KGZ" => Ok(IsoCountryCode::KG),
                "KHM" => Ok(IsoCountryCode::KH),
                "KIR" => Ok(IsoCountryCode::KI),
                "COM" => Ok(IsoCountryCode::KM),
                "KNA" => Ok(IsoCountryCode::KN),
                "PRK" => Ok(IsoCountryCode::KP),
                "KOR" => Ok(IsoCountryCode::KR),
                "XKX" => Ok(IsoCountryCode::XK),
                "KWT" => Ok(IsoCountryCode::KW),
                "CYM" => Ok(IsoCountryCode::KY),
                "KAZ" => Ok(IsoCountryCode::KZ),
                "LAO" => Ok(IsoCountryCode::LA),
                "LBN" => Ok(IsoCountryCode::LB),
                "LCA" => Ok(IsoCountryCode::LC),
                "LIE" => Ok(IsoCountryCode::LI),
                "LKA" => Ok(IsoCountryCode::LK),
                "LBR" => Ok(IsoCountryCode::LR),
                "LSO" => Ok(IsoCountryCode::LS),
                "LTU" => Ok(IsoCountryCode::LT),
                "LUX" => Ok(IsoCountryCode::LU),
                "LVA" => Ok(IsoCountryCode::LV),
                "LBY" => Ok(IsoCountryCode::LY),
                "MAR" => Ok(IsoCountryCode::MA),
                "MCO" => Ok(IsoCountryCode::MC),
                "MDA" => Ok(IsoCountryCode::MD),
                "MNE" => Ok(IsoCountryCode::ME),
                "MAF" => Ok(IsoCountryCode::MF),
                "MDG" => Ok(IsoCountryCode::MG),
                "MHL" => Ok(IsoCountryCode::MH),
                "MKD" => Ok(IsoCountryCode::MK),
                "MLI" => Ok(IsoCountryCode::ML),
                "MMR" => Ok(IsoCountryCode::MM),
                "MNG" => Ok(IsoCountryCode::MN),
                "MAC" => Ok(IsoCountryCode::MO),
                "MNP" => Ok(IsoCountryCode::MP),
                "MTQ" => Ok(IsoCountryCode::MQ),
                "MRT" => Ok(IsoCountryCode::MR),
                "MSR" => Ok(IsoCountryCode::MS),
                "MLT" => Ok(IsoCountryCode::MT),
                "MUS" => Ok(IsoCountryCode::MU),
                "MDV" => Ok(IsoCountryCode::MV),
                "MWI" => Ok(IsoCountryCode::MW),
                "MEX" => Ok(IsoCountryCode::MX),
                "MYS" => Ok(IsoCountryCode::MY),
                "MOZ" => Ok(IsoCountryCode::MZ),
                "NAM" => Ok(IsoCountryCode::NA),
                "NCL" => Ok(IsoCountryCode::NC),
                "NER" => Ok(IsoCountryCode::NE),
                "NFK" => Ok(IsoCountryCode::NF),
                "NGA" => Ok(IsoCountryCode::NG),
                "NIC" => Ok(IsoCountryCode::NI),
                "NLD" => Ok(IsoCountryCode::NL),
                "NOR" => Ok(IsoCountryCode::NO),
                "NPL" => Ok(IsoCountryCode::NP),
                "NRU" => Ok(IsoCountryCode::NR),
                "NIU" => Ok(IsoCountryCode::NU),
                "NZL" => Ok(IsoCountryCode::NZ),
                "OMN" => Ok(IsoCountryCode::OM),
                "PAN" => Ok(IsoCountryCode::PA),
                "PER" => Ok(IsoCountryCode::PE),
                "PYF" => Ok(IsoCountryCode::PF),
                "PNG" => Ok(IsoCountryCode::PG),
                "PHL" => Ok(IsoCountryCode::PH),
                "PAK" => Ok(IsoCountryCode::PK),
                "POL" => Ok(IsoCountryCode::PL),
                "SPM" => Ok(IsoCountryCode::PM),
                "PCN" => Ok(IsoCountryCode::PN),
                "PRI" => Ok(IsoCountryCode::PR),
                "PSE" => Ok(IsoCountryCode::PS),
                "PRT" => Ok(IsoCountryCode::PT),
                "PLW" => Ok(IsoCountryCode::PW),
                "PRY" => Ok(IsoCountryCode::PY),
                "QAT" => Ok(IsoCountryCode::QA),
                "REU" => Ok(IsoCountryCode::RE),
                "ROU" => Ok(IsoCountryCode::RO),
                "SRB" => Ok(IsoCountryCode::RS),
                "RUS" => Ok(IsoCountryCode::RU),
                "RWA" => Ok(IsoCountryCode::RW),
                "SAU" => Ok(IsoCountryCode::SA),
                "SLB" => Ok(IsoCountryCode::SB),
                "SYC" => Ok(IsoCountryCode::SC),
                "SDN" => Ok(IsoCountryCode::SD),
                "SSD" => Ok(IsoCountryCode::SS),
                "SWE" => Ok(IsoCountryCode::SE),
                "SGP" => Ok(IsoCountryCode::SG),
                "SHN" => Ok(IsoCountryCode::SH),
                "SVN" => Ok(IsoCountryCode::SI),
                "SJM" => Ok(IsoCountryCode::SJ),
                "SVK" => Ok(IsoCountryCode::SK),
                "SLE" => Ok(IsoCountryCode::SL),
                "SMR" => Ok(IsoCountryCode::SM),
                "SEN" => Ok(IsoCountryCode::SN),
                "SOM" => Ok(IsoCountryCode::SO),
                "SUR" => Ok(IsoCountryCode::SR),
                "STP" => Ok(IsoCountryCode::ST),
                "SLV" => Ok(IsoCountryCode::SV),
                "SXM" => Ok(IsoCountryCode::SX),
                "SYR" => Ok(IsoCountryCode::SY),
                "SWZ" => Ok(IsoCountryCode::SZ),
                "TCA" => Ok(IsoCountryCode::TC),
                "TCD" => Ok(IsoCountryCode::TD),
                "ATF" => Ok(IsoCountryCode::TF),
                "TGO" => Ok(IsoCountryCode::TG),
                "THA" => Ok(IsoCountryCode::TH),
                "TJK" => Ok(IsoCountryCode::TJ),
                "TKL" => Ok(IsoCountryCode::TK),
                "TLS" => Ok(IsoCountryCode::TL),
                "TKM" => Ok(IsoCountryCode::TM),
                "TUN" => Ok(IsoCountryCode::TN),
                "TON" => Ok(IsoCountryCode::TO),
                "TUR" => Ok(IsoCountryCode::TR),
                "TTO" => Ok(IsoCountryCode::TT),
                "TUV" => Ok(IsoCountryCode::TV),
                "TWN" => Ok(IsoCountryCode::TW),
                "TZA" => Ok(IsoCountryCode::TZ),
                "UKR" => Ok(IsoCountryCode::UA),
                "UGA" => Ok(IsoCountryCode::UG),
                "UMI" => Ok(IsoCountryCode::UM),
                "USA" => Ok(IsoCountryCode::US),
                "URY" => Ok(IsoCountryCode::UY),
                "UZB" => Ok(IsoCountryCode::UZ),
                "VAT" => Ok(IsoCountryCode::VA),
                "VCT" => Ok(IsoCountryCode::VC),
                "VEN" => Ok(IsoCountryCode::VE),
                "VGB" => Ok(IsoCountryCode::VG),
                "VIR" => Ok(IsoCountryCode::VI),
                "VNM" => Ok(IsoCountryCode::VN),
                "VUT" => Ok(IsoCountryCode::VU),
                "WLF" => Ok(IsoCountryCode::WF),
                "WSM" => Ok(IsoCountryCode::WS),
                "YEM" => Ok(IsoCountryCode::YE),
                "MYT" => Ok(IsoCountryCode::YT),
                "ZAF" => Ok(IsoCountryCode::ZA),
                "ZMB" => Ok(IsoCountryCode::ZM),
                "ZWE" => Ok(IsoCountryCode::ZW),
                "SCG" => Ok(IsoCountryCode::CS),
                "ANT" => Ok(IsoCountryCode::AN),
                _ => Err(()),
            },
            _ => Err(()),
        }
    }
}
